#spreadplayers 242 756 0 3 false @e[name=随机,type=area_effect_cloud]
#tp @e[name=随机] ~ 23 ~

#execute @e[name=随机] ~ ~ ~ detect ~ ~-1 ~ wool 0 function chest:类型/材料箱
#execute @e[name=随机] ~ ~ ~ detect ~ ~-1 ~ wool 2 function chest:类型/食物箱
#execute @e[name=随机] ~ ~ ~ detect ~ ~-1 ~ wool 3 function chest:类型/医药箱
#execute @e[name=随机] ~ ~ ~ detect ~ ~-1 ~ wool 4 function chest:类型/武器箱
#execute @e[name=随机] ~ ~ ~ detect ~ ~-1 ~ wool 5 function chest:类型/军用武器箱
#execute @p[score_开箱_min=1] ~ ~ ~ function chest:开服庆典
#execute @e[tag=奖励箱被开启] ~ ~ ~ blockdata ~ ~ ~ {display:{Name:"chest"},CustomName:"材料箱",LootTable:"minecraft:gameplay/fishing/fish"}

playsound minecraft:block.anvil.land player @a[r=6] ~ ~ ~ 0.7 1.3 0.7
scoreboard players set @s 随机数MAX 100
function main:取随机数
function chestNEW:类型/材料箱 if @s[score_随机数=39]
function chestNEW:类型/食物箱 if @s[score_随机数_min=40,score_随机数=59]
function chestNEW:类型/医药箱 if @s[score_随机数_min=60,score_随机数=69]
function chestNEW:类型/武器箱 if @s[score_随机数_min=70,score_随机数=89]
function chestNEW:类型/军用武器箱 if @s[score_随机数_min=90]
scoreboard players reset @s 随机数


scoreboard players set @s 随机数MAX 10
function main:取随机数
execute @s[score_随机数_min=8] ~ ~ ~ summon minecraft:vex ~ ~2 ~ {CustomName:"冢灵",CustomNameVisible:1b,Health:2f,Attributes:[{Base:1d,Name:"generic.maxHealth"}]}
scoreboard players reset @s 随机数